package com.xrc.HomeWork.jicheng;

public class CheckAccount extends Account{
    double overdraft;
    public void withdraw(double amount){
        if(amount<balance){
            balance-=amount;
            System.out.println("您的账户余额："+balance);
            System.out.println("您的账户可透支："+overdraft);
        }else if((overdraft+balance)>amount){
            overdraft=overdraft-(amount-balance);
            setBalance(0.0);
            System.out.println("您的账户余额："+balance);
            System.out.println("您的账户可透支："+overdraft);

        }else {
            System.out.println("提款金额超过可透支限额");
        }


    }
}
